<script setup>
import {ref} from "vue";

const rq = ref('');
const tr = ref([]);
const f = () =>{
  console.log(tr.value);
  console.log(tr.value[0]);
  console.log(tr.value[1]);
}

</script>

<template>
<h1>日期时间选择器组件</h1>
  <el-date-picker
  type="date"
  v-model="rq"
  format="YYYY-MM-DD"
  value-format="YYYY-MM-DD"
  @change="console.log(rq)"
  ></el-date-picker>
<tr></tr>
  <el-date-picker
      type="datetimerange"
      v-model="tr"
      format="YYYY-MM-DD HH:mm:ss"
      value-format="YYYY-MM-DD HH:mm:ss"
      start-placeholder="开始日期"
      end-placeholder="结束日期"
      range-separator="至"
      @change="f"
  ></el-date-picker>
</template>
<style scoped>

</style>